python convert text file into binary code